package com.yanqu.road.logic.bussiness.player.activity;

import com.yanqu.road.entity.activity.UserActivityConditionData;
import com.yanqu.road.logic.bussiness.DaoHelper;

import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

public class GeneralActivityBusiness {

    public static List<UserActivityConditionData> getUserActivityConditionDataList(int activityId, Integer conditionType, int rankNum) {
        return DaoHelper.getUserActivityDaoImpl().getUserActivityConditionDataList(activityId,conditionType,rankNum);
    }


    public static Map<Long, UserActivityConditionData> getUserActivityRankConditionTypeDataMap(int activityId, Integer conditionType) {
        List<UserActivityConditionData> list = DaoHelper.getUserActivityDaoImpl().getUserActivityConditionDataListByType(activityId, conditionType);
        Map<Long, UserActivityConditionData> dataMap = new ConcurrentHashMap<>();
        for (UserActivityConditionData data : list) {
            dataMap.put(data.getUserId(), data);
        }
        return dataMap;
    }
}
